// import i18n from '@/lang'
// import store from '@/store'
import Vue from 'vue';
// import router from '@/router'
/**
 * @Description: 挂载载体
 * @author BloodCat(JousenZhou)
 * @date 2020/11/27
 */
/*
 * components 挂载的实例组件
 * parameter 参数
 * callback 回调函数
 * */
export default async function (components, parameter, callback) {
    let constructor = Vue.extend(components);
    let instance = new constructor({
        // i18n,
        // store,
        // router
    });
    instance.vm = instance.$mount();
    document.body.appendChild(instance.vm.$el);
    instance.vm.visible = true;
    instance.dom = instance.vm.$el;
    const destroy = () => {
        instance.$destroy(true);
        instance = null;
        constructor = null;
    };
    await instance.$view(parameter, callback, destroy);
}
